var mysql = require('mysql');
var connection = mysql.createConnection({
    host: 'localhost',
    user: 'juzao',
    password: '123456',
    database: 'javastu',
    connectTimeout:6000,
    multipleStatements: true
});
connection.connect();
module.exports = (sql) => {
    return new Promise(next => {

        connection.query(sql, function (error, results, fields) {
            if (error) throw error;

            next(results,error)
        });
        // connection.end()
    })
}

